import React from 'react';
import Footer from '../widget/footer/footer.jsx';
import '../index/index.scss';
import './user.scss';
import { message } from 'antd';
import { employeeInfo } from 'api/user.js';
import {
	Link
} from 'react-router-dom';
class User extends React.Component{
	constructor (props) {
		super(props)
		this.state={
			userInfo: {}
		}
	}
	componentDidMount(){
		document.title = '我的';
		employeeInfo().then(res => {
			if (res.code === 1) {
				this.setState({
					userInfo: res.data
				})
			} else {
				message.error(res.message,3)
			}
		})
	}
	render() {
		return(
			<div className="user">
				{/*<div className="title">
					<div><i className="glyphicon glyphicon-close"></i></div>
					<div>我的</div>
					<div><i className="glyphicon glyphicon-options"></i></div>
				</div>*/}
				<div className="user_header">
					<div className="user_card">
						<div className="user_card_header">
							<img src={this.state.userInfo.employee_img} alt="lalal"/>
							<div>
								<p className="user_name">{this.state.userInfo.employee_name}<Link to="./user/perfectCard"><i className="glyphicon glyphicon-modify"></i></Link></p>
								<span className="user_position">{this.state.userInfo.position_name}</span>
							</div>
						</div>
						<p className="user_company">{this.state.userInfo.company_name}</p>
						<p>电话：{this.state.userInfo.telephone}</p>
						<p>邮箱：{this.state.userInfo.email}</p>
					</div>
				</div>
				<div className="user_box">
					<Link to={`${window.baseUrl}/user/myCard`}><div><i className="glyphicon glyphicon-mycard"></i>我的名片<i className="glyphicon glyphicon-right right"></i></div></Link>
					{/*<div><i className="glyphicon glyphicon-label1"></i>我的标签<i className="glyphicon glyphicon-right right"></i></div>*/}
				</div>
				<div className="user_box">
					<Link to={
						{
							pathname: `${window.baseUrl}/user/labelMy`,
							state: {
								personal_signature: this.state.userInfo.personal_signature
							}
						}
					}><div><i className="glyphicon glyphicon-signature"></i>个性签名<i className="glyphicon glyphicon-right right"></i></div></Link>
					<Link to="./user/uploadPic"><div><i className="glyphicon glyphicon-pic"></i>上传图片<i className="glyphicon glyphicon-right right"></i></div></Link>
				</div>
				<div className="user_box">
					<Link to="./user/myProduct"><div><i className="glyphicon glyphicon-prc"></i>我的产品<i className="glyphicon glyphicon-right right"></i></div></Link>
					<Link to="./moments"><div><i className="glyphicon glyphicon-ment"></i>公司动态<i className="glyphicon glyphicon-right right"></i></div></Link>
					<Link to="./report"><div><i className="glyphicon glyphicon-report"></i>我的报表<i className="glyphicon glyphicon-right right"></i></div></Link>
					<Link to="./client/label"><div><i className="glyphicon glyphicon-labelgul"></i>标签管理<i className="glyphicon glyphicon-right right"></i></div></Link>
					<Link to={
						{
							pathname: `${window.baseUrl}/user/welcomeLag`,
							state: {
								auto_reply: this.state.userInfo.auto_reply,
								auto_reply_status: this.state.userInfo.auto_reply_status
							}
						}
					}><div><i className="glyphicon glyphicon-msg"></i>消息设置<i className="glyphicon glyphicon-right right"></i></div></Link>
				</div>
				<div className="myCard_height"></div>
				<Footer/>
			</div>
			)
	}
}
export default User;
